import React from 'react';
import { View, Text, TouchableOpacity, Touchable,Image} from 'react-native';
import moment from 'moment'
import navigationhelper from 'src/components/navigationhelper'
import {CalendarList, LocaleConfig} from 'react-native-calendars';
import NavBar from 'src/components/navBar'
import Layer from 'src/components/Layer'
import {isIPhoneX,deviceWidth} from 'src/util'
import ScrollableTabView from 'react-native-scrollable-tab-view'




export default class cardManagerCell extends React.Component {

    constructor(props) {
      super(props);

    }

    render(){
        const {itemData,typeCard} = this.props
        return(
        <View style={{backgroundColor:'#fff',paddingVertical:10,flexDirection:'row'}}>
          <Image style={{marginTop:5,marginLeft:10,width:30,height:30}} source={{uri:itemData.bank_logo}}>
          </Image>
        <View style={{marginLeft: 10,backgroundColor:'#fff',flexDirection:'column'}}>
        <Text style={{color:'#2E2E2E',fontSize:16,fontWeight:'bold'}}>{itemData.name}</Text>
        <Text style={{color:'#8E8E93',fontSize:12,marginTop:10}}>{'***********'+itemData.card_number}</Text>
        </View>
      {typeCard == 1? 
     <TouchableOpacity
      style={{position:'absolute',right:20,top:20}}
      activeOpacity ={0.8} onPress={()=>{
        this.props.deleteCard()
        // {typeCard == 1?navigationhelper.navigate('ChangeCreditCard'):navigationhelper.navigate('ChangeSaveCard')}
      }}>
      <Image style={{width:25,height:25}} source={require('src/assets/cardManager/deleteCard.png')}>
       </Image>
       </TouchableOpacity>
       :null
      }
        </View>
        ) 
    }
 }